﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.6
// Code is generated on: 02 November 2012 16:44:35
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using NetDon.OA.Data.HelperClasses;

using NetDon.OA.Data.EntityClasses;
using NetDon.OA.Data.RelationClasses;
using NetDon.OA.Data.DaoClasses;
using NetDon.OA.Data.CollectionClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NetDon.OA.Data.FactoryClasses
{
	
	// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
	// __LLBLGENPRO_USER_CODE_REGION_END
	
	/// <summary>general base class for the generated factories</summary>
	[Serializable]
	public partial class EntityFactoryBase : EntityFactoryCore
	{
		private string _entityName;
		private NetDon.OA.Data.EntityType _typeOfEntity;
		
		/// <summary>CTor</summary>
		/// <param name="entityName">Name of the entity.</param>
		/// <param name="typeOfEntity">The type of entity.</param>
		public EntityFactoryBase(string entityName, NetDon.OA.Data.EntityType typeOfEntity)
		{
			_entityName = entityName;
			_typeOfEntity = typeOfEntity;
		}

		/// <summary>Creates a new entity instance using the GeneralEntityFactory in the generated code, using the passed in entitytype value</summary>
		/// <param name="entityTypeValue">The entity type value of the entity to create an instance for.</param>
		/// <returns>new IEntity instance</returns>
		public override IEntity CreateEntityFromEntityTypeValue(int entityTypeValue)
		{
			return GeneralEntityFactory.Create((NetDon.OA.Data.EntityType)entityTypeValue);
		}
		
		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public override IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(_typeOfEntity);
		}

		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <param name="objectAlias">The object alias to use for the elements in the relations.</param>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public override IRelationCollection CreateHierarchyRelations(string objectAlias) 
		{
			return InheritanceInfoProviderSingleton.GetInstance().GetHierarchyRelations(_entityName, objectAlias);
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public override IEntityFactory GetEntityFactory(object[] fieldValues, Dictionary<string, int> entityFieldStartIndexesPerEntity)
		{
			IEntityFactory toReturn = (IEntityFactory)InheritanceInfoProviderSingleton.GetInstance().GetEntityFactory(_entityName, fieldValues, entityFieldStartIndexesPerEntity);
			if(toReturn == null)
			{
				toReturn = this;
			}
			return toReturn;
		}
						
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public override IEntityCollection CreateEntityCollection()
		{
			return GeneralEntityCollectionFactory.Create(_typeOfEntity);
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public override string ForEntityName 
		{ 
			get { return _entityName; }
		}
	}
	
	/// <summary>Factory to create new, empty AreaEntity objects.</summary>
	[Serializable]
	public partial class AreaEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public AreaEntityFactory() : base("AreaEntity", NetDon.OA.Data.EntityType.AreaEntity) { }

		/// <summary>Creates a new, empty AreaEntity object.</summary>
		/// <returns>A new, empty AreaEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new AreaEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewArea
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new AreaEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewAreaUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty AttachmentsEntity objects.</summary>
	[Serializable]
	public partial class AttachmentsEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public AttachmentsEntityFactory() : base("AttachmentsEntity", NetDon.OA.Data.EntityType.AttachmentsEntity) { }

		/// <summary>Creates a new, empty AttachmentsEntity object.</summary>
		/// <returns>A new, empty AttachmentsEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new AttachmentsEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewAttachments
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new AttachmentsEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewAttachmentsUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty CityEntity objects.</summary>
	[Serializable]
	public partial class CityEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public CityEntityFactory() : base("CityEntity", NetDon.OA.Data.EntityType.CityEntity) { }

		/// <summary>Creates a new, empty CityEntity object.</summary>
		/// <returns>A new, empty CityEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new CityEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCity
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new CityEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCityUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty CompanyEntity objects.</summary>
	[Serializable]
	public partial class CompanyEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public CompanyEntityFactory() : base("CompanyEntity", NetDon.OA.Data.EntityType.CompanyEntity) { }

		/// <summary>Creates a new, empty CompanyEntity object.</summary>
		/// <returns>A new, empty CompanyEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new CompanyEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCompany
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new CompanyEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCompanyUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ConfigurationEntity objects.</summary>
	[Serializable]
	public partial class ConfigurationEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ConfigurationEntityFactory() : base("ConfigurationEntity", NetDon.OA.Data.EntityType.ConfigurationEntity) { }

		/// <summary>Creates a new, empty ConfigurationEntity object.</summary>
		/// <returns>A new, empty ConfigurationEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ConfigurationEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewConfiguration
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new ConfigurationEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewConfigurationUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty CustomerGoodsShippingTypeEntity objects.</summary>
	[Serializable]
	public partial class CustomerGoodsShippingTypeEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public CustomerGoodsShippingTypeEntityFactory() : base("CustomerGoodsShippingTypeEntity", NetDon.OA.Data.EntityType.CustomerGoodsShippingTypeEntity) { }

		/// <summary>Creates a new, empty CustomerGoodsShippingTypeEntity object.</summary>
		/// <returns>A new, empty CustomerGoodsShippingTypeEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new CustomerGoodsShippingTypeEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCustomerGoodsShippingType
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new CustomerGoodsShippingTypeEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCustomerGoodsShippingTypeUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty CustomerInfoEntity objects.</summary>
	[Serializable]
	public partial class CustomerInfoEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public CustomerInfoEntityFactory() : base("CustomerInfoEntity", NetDon.OA.Data.EntityType.CustomerInfoEntity) { }

		/// <summary>Creates a new, empty CustomerInfoEntity object.</summary>
		/// <returns>A new, empty CustomerInfoEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new CustomerInfoEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCustomerInfo
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new CustomerInfoEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCustomerInfoUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty DeliveryOrderCodeConfigEntity objects.</summary>
	[Serializable]
	public partial class DeliveryOrderCodeConfigEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public DeliveryOrderCodeConfigEntityFactory() : base("DeliveryOrderCodeConfigEntity", NetDon.OA.Data.EntityType.DeliveryOrderCodeConfigEntity) { }

		/// <summary>Creates a new, empty DeliveryOrderCodeConfigEntity object.</summary>
		/// <returns>A new, empty DeliveryOrderCodeConfigEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new DeliveryOrderCodeConfigEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDeliveryOrderCodeConfig
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new DeliveryOrderCodeConfigEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDeliveryOrderCodeConfigUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty DepartmentEntity objects.</summary>
	[Serializable]
	public partial class DepartmentEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public DepartmentEntityFactory() : base("DepartmentEntity", NetDon.OA.Data.EntityType.DepartmentEntity) { }

		/// <summary>Creates a new, empty DepartmentEntity object.</summary>
		/// <returns>A new, empty DepartmentEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new DepartmentEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDepartment
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new DepartmentEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDepartmentUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty DepartmentManagerEntity objects.</summary>
	[Serializable]
	public partial class DepartmentManagerEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public DepartmentManagerEntityFactory() : base("DepartmentManagerEntity", NetDon.OA.Data.EntityType.DepartmentManagerEntity) { }

		/// <summary>Creates a new, empty DepartmentManagerEntity object.</summary>
		/// <returns>A new, empty DepartmentManagerEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new DepartmentManagerEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDepartmentManager
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new DepartmentManagerEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDepartmentManagerUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty DictionaryEntity objects.</summary>
	[Serializable]
	public partial class DictionaryEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public DictionaryEntityFactory() : base("DictionaryEntity", NetDon.OA.Data.EntityType.DictionaryEntity) { }

		/// <summary>Creates a new, empty DictionaryEntity object.</summary>
		/// <returns>A new, empty DictionaryEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new DictionaryEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDictionary
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new DictionaryEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDictionaryUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty DictionaryCategoryEntity objects.</summary>
	[Serializable]
	public partial class DictionaryCategoryEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public DictionaryCategoryEntityFactory() : base("DictionaryCategoryEntity", NetDon.OA.Data.EntityType.DictionaryCategoryEntity) { }

		/// <summary>Creates a new, empty DictionaryCategoryEntity object.</summary>
		/// <returns>A new, empty DictionaryCategoryEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new DictionaryCategoryEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDictionaryCategory
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new DictionaryCategoryEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDictionaryCategoryUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty FunctionEntity objects.</summary>
	[Serializable]
	public partial class FunctionEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public FunctionEntityFactory() : base("FunctionEntity", NetDon.OA.Data.EntityType.FunctionEntity) { }

		/// <summary>Creates a new, empty FunctionEntity object.</summary>
		/// <returns>A new, empty FunctionEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new FunctionEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewFunction
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new FunctionEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewFunctionUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty GoodsTravelDaysConfigEntity objects.</summary>
	[Serializable]
	public partial class GoodsTravelDaysConfigEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public GoodsTravelDaysConfigEntityFactory() : base("GoodsTravelDaysConfigEntity", NetDon.OA.Data.EntityType.GoodsTravelDaysConfigEntity) { }

		/// <summary>Creates a new, empty GoodsTravelDaysConfigEntity object.</summary>
		/// <returns>A new, empty GoodsTravelDaysConfigEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new GoodsTravelDaysConfigEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewGoodsTravelDaysConfig
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new GoodsTravelDaysConfigEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewGoodsTravelDaysConfigUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ImageEntity objects.</summary>
	[Serializable]
	public partial class ImageEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ImageEntityFactory() : base("ImageEntity", NetDon.OA.Data.EntityType.ImageEntity) { }

		/// <summary>Creates a new, empty ImageEntity object.</summary>
		/// <returns>A new, empty ImageEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ImageEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewImage
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new ImageEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewImageUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty IssuingOrderEntity objects.</summary>
	[Serializable]
	public partial class IssuingOrderEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public IssuingOrderEntityFactory() : base("IssuingOrderEntity", NetDon.OA.Data.EntityType.IssuingOrderEntity) { }

		/// <summary>Creates a new, empty IssuingOrderEntity object.</summary>
		/// <returns>A new, empty IssuingOrderEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new IssuingOrderEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrder
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new IssuingOrderEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty IssuingOrderDeliveryEntity objects.</summary>
	[Serializable]
	public partial class IssuingOrderDeliveryEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public IssuingOrderDeliveryEntityFactory() : base("IssuingOrderDeliveryEntity", NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity) { }

		/// <summary>Creates a new, empty IssuingOrderDeliveryEntity object.</summary>
		/// <returns>A new, empty IssuingOrderDeliveryEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new IssuingOrderDeliveryEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderDelivery
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new IssuingOrderDeliveryEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderDeliveryUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty IssuingOrderOnWayTrackEntity objects.</summary>
	[Serializable]
	public partial class IssuingOrderOnWayTrackEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public IssuingOrderOnWayTrackEntityFactory() : base("IssuingOrderOnWayTrackEntity", NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackEntity) { }

		/// <summary>Creates a new, empty IssuingOrderOnWayTrackEntity object.</summary>
		/// <returns>A new, empty IssuingOrderOnWayTrackEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new IssuingOrderOnWayTrackEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderOnWayTrack
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new IssuingOrderOnWayTrackEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderOnWayTrackUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty IssuingOrderOnWayTrackCommentEntity objects.</summary>
	[Serializable]
	public partial class IssuingOrderOnWayTrackCommentEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public IssuingOrderOnWayTrackCommentEntityFactory() : base("IssuingOrderOnWayTrackCommentEntity", NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackCommentEntity) { }

		/// <summary>Creates a new, empty IssuingOrderOnWayTrackCommentEntity object.</summary>
		/// <returns>A new, empty IssuingOrderOnWayTrackCommentEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new IssuingOrderOnWayTrackCommentEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderOnWayTrackComment
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new IssuingOrderOnWayTrackCommentEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderOnWayTrackCommentUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty IssuingOrderOnWayTrackHistoryEntity objects.</summary>
	[Serializable]
	public partial class IssuingOrderOnWayTrackHistoryEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public IssuingOrderOnWayTrackHistoryEntityFactory() : base("IssuingOrderOnWayTrackHistoryEntity", NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackHistoryEntity) { }

		/// <summary>Creates a new, empty IssuingOrderOnWayTrackHistoryEntity object.</summary>
		/// <returns>A new, empty IssuingOrderOnWayTrackHistoryEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new IssuingOrderOnWayTrackHistoryEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderOnWayTrackHistory
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new IssuingOrderOnWayTrackHistoryEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderOnWayTrackHistoryUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty IssuingOrderReceiptInfoTrackEntity objects.</summary>
	[Serializable]
	public partial class IssuingOrderReceiptInfoTrackEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public IssuingOrderReceiptInfoTrackEntityFactory() : base("IssuingOrderReceiptInfoTrackEntity", NetDon.OA.Data.EntityType.IssuingOrderReceiptInfoTrackEntity) { }

		/// <summary>Creates a new, empty IssuingOrderReceiptInfoTrackEntity object.</summary>
		/// <returns>A new, empty IssuingOrderReceiptInfoTrackEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new IssuingOrderReceiptInfoTrackEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderReceiptInfoTrack
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new IssuingOrderReceiptInfoTrackEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderReceiptInfoTrackUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty IssuingOrderReceiptInfoTrackCommentEntity objects.</summary>
	[Serializable]
	public partial class IssuingOrderReceiptInfoTrackCommentEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public IssuingOrderReceiptInfoTrackCommentEntityFactory() : base("IssuingOrderReceiptInfoTrackCommentEntity", NetDon.OA.Data.EntityType.IssuingOrderReceiptInfoTrackCommentEntity) { }

		/// <summary>Creates a new, empty IssuingOrderReceiptInfoTrackCommentEntity object.</summary>
		/// <returns>A new, empty IssuingOrderReceiptInfoTrackCommentEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new IssuingOrderReceiptInfoTrackCommentEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderReceiptInfoTrackComment
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new IssuingOrderReceiptInfoTrackCommentEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderReceiptInfoTrackCommentUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty IssuingOrderVehicleInfoEntity objects.</summary>
	[Serializable]
	public partial class IssuingOrderVehicleInfoEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public IssuingOrderVehicleInfoEntityFactory() : base("IssuingOrderVehicleInfoEntity", NetDon.OA.Data.EntityType.IssuingOrderVehicleInfoEntity) { }

		/// <summary>Creates a new, empty IssuingOrderVehicleInfoEntity object.</summary>
		/// <returns>A new, empty IssuingOrderVehicleInfoEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new IssuingOrderVehicleInfoEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderVehicleInfo
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new IssuingOrderVehicleInfoEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewIssuingOrderVehicleInfoUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty LogEntity objects.</summary>
	[Serializable]
	public partial class LogEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public LogEntityFactory() : base("LogEntity", NetDon.OA.Data.EntityType.LogEntity) { }

		/// <summary>Creates a new, empty LogEntity object.</summary>
		/// <returns>A new, empty LogEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new LogEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewLog
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new LogEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewLogUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty MachineAccountIncomeEntity objects.</summary>
	[Serializable]
	public partial class MachineAccountIncomeEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public MachineAccountIncomeEntityFactory() : base("MachineAccountIncomeEntity", NetDon.OA.Data.EntityType.MachineAccountIncomeEntity) { }

		/// <summary>Creates a new, empty MachineAccountIncomeEntity object.</summary>
		/// <returns>A new, empty MachineAccountIncomeEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new MachineAccountIncomeEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewMachineAccountIncome
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new MachineAccountIncomeEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewMachineAccountIncomeUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty MachineAccountPaymentEntity objects.</summary>
	[Serializable]
	public partial class MachineAccountPaymentEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public MachineAccountPaymentEntityFactory() : base("MachineAccountPaymentEntity", NetDon.OA.Data.EntityType.MachineAccountPaymentEntity) { }

		/// <summary>Creates a new, empty MachineAccountPaymentEntity object.</summary>
		/// <returns>A new, empty MachineAccountPaymentEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new MachineAccountPaymentEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewMachineAccountPayment
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new MachineAccountPaymentEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewMachineAccountPaymentUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty PostEntity objects.</summary>
	[Serializable]
	public partial class PostEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public PostEntityFactory() : base("PostEntity", NetDon.OA.Data.EntityType.PostEntity) { }

		/// <summary>Creates a new, empty PostEntity object.</summary>
		/// <returns>A new, empty PostEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new PostEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewPost
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new PostEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewPostUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ProductEntity objects.</summary>
	[Serializable]
	public partial class ProductEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ProductEntityFactory() : base("ProductEntity", NetDon.OA.Data.EntityType.ProductEntity) { }

		/// <summary>Creates a new, empty ProductEntity object.</summary>
		/// <returns>A new, empty ProductEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ProductEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProduct
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new ProductEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProductUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ProvinceEntity objects.</summary>
	[Serializable]
	public partial class ProvinceEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ProvinceEntityFactory() : base("ProvinceEntity", NetDon.OA.Data.EntityType.ProvinceEntity) { }

		/// <summary>Creates a new, empty ProvinceEntity object.</summary>
		/// <returns>A new, empty ProvinceEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ProvinceEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProvince
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new ProvinceEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProvinceUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ReportEntity objects.</summary>
	[Serializable]
	public partial class ReportEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ReportEntityFactory() : base("ReportEntity", NetDon.OA.Data.EntityType.ReportEntity) { }

		/// <summary>Creates a new, empty ReportEntity object.</summary>
		/// <returns>A new, empty ReportEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ReportEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewReport
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new ReportEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewReportUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ReportCategoryEntity objects.</summary>
	[Serializable]
	public partial class ReportCategoryEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ReportCategoryEntityFactory() : base("ReportCategoryEntity", NetDon.OA.Data.EntityType.ReportCategoryEntity) { }

		/// <summary>Creates a new, empty ReportCategoryEntity object.</summary>
		/// <returns>A new, empty ReportCategoryEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ReportCategoryEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewReportCategory
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new ReportCategoryEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewReportCategoryUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty RevenueMachineAccountEntity objects.</summary>
	[Serializable]
	public partial class RevenueMachineAccountEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public RevenueMachineAccountEntityFactory() : base("RevenueMachineAccountEntity", NetDon.OA.Data.EntityType.RevenueMachineAccountEntity) { }

		/// <summary>Creates a new, empty RevenueMachineAccountEntity object.</summary>
		/// <returns>A new, empty RevenueMachineAccountEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new RevenueMachineAccountEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRevenueMachineAccount
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new RevenueMachineAccountEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRevenueMachineAccountUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty RevenueMachineAccountInvoiceEntity objects.</summary>
	[Serializable]
	public partial class RevenueMachineAccountInvoiceEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public RevenueMachineAccountInvoiceEntityFactory() : base("RevenueMachineAccountInvoiceEntity", NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceEntity) { }

		/// <summary>Creates a new, empty RevenueMachineAccountInvoiceEntity object.</summary>
		/// <returns>A new, empty RevenueMachineAccountInvoiceEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new RevenueMachineAccountInvoiceEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRevenueMachineAccountInvoice
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new RevenueMachineAccountInvoiceEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRevenueMachineAccountInvoiceUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty RevenueMachineAccountInvoiceOrderEntity objects.</summary>
	[Serializable]
	public partial class RevenueMachineAccountInvoiceOrderEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public RevenueMachineAccountInvoiceOrderEntityFactory() : base("RevenueMachineAccountInvoiceOrderEntity", NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceOrderEntity) { }

		/// <summary>Creates a new, empty RevenueMachineAccountInvoiceOrderEntity object.</summary>
		/// <returns>A new, empty RevenueMachineAccountInvoiceOrderEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new RevenueMachineAccountInvoiceOrderEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRevenueMachineAccountInvoiceOrder
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new RevenueMachineAccountInvoiceOrderEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRevenueMachineAccountInvoiceOrderUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty RevenueMachineAccountInvoiceReceiptEntity objects.</summary>
	[Serializable]
	public partial class RevenueMachineAccountInvoiceReceiptEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public RevenueMachineAccountInvoiceReceiptEntityFactory() : base("RevenueMachineAccountInvoiceReceiptEntity", NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceReceiptEntity) { }

		/// <summary>Creates a new, empty RevenueMachineAccountInvoiceReceiptEntity object.</summary>
		/// <returns>A new, empty RevenueMachineAccountInvoiceReceiptEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new RevenueMachineAccountInvoiceReceiptEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRevenueMachineAccountInvoiceReceipt
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new RevenueMachineAccountInvoiceReceiptEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRevenueMachineAccountInvoiceReceiptUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty RoleEntity objects.</summary>
	[Serializable]
	public partial class RoleEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public RoleEntityFactory() : base("RoleEntity", NetDon.OA.Data.EntityType.RoleEntity) { }

		/// <summary>Creates a new, empty RoleEntity object.</summary>
		/// <returns>A new, empty RoleEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new RoleEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRole
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new RoleEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRoleUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty RoleFunctionEntity objects.</summary>
	[Serializable]
	public partial class RoleFunctionEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public RoleFunctionEntityFactory() : base("RoleFunctionEntity", NetDon.OA.Data.EntityType.RoleFunctionEntity) { }

		/// <summary>Creates a new, empty RoleFunctionEntity object.</summary>
		/// <returns>A new, empty RoleFunctionEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new RoleFunctionEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRoleFunction
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new RoleFunctionEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRoleFunctionUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty RouteEntity objects.</summary>
	[Serializable]
	public partial class RouteEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public RouteEntityFactory() : base("RouteEntity", NetDon.OA.Data.EntityType.RouteEntity) { }

		/// <summary>Creates a new, empty RouteEntity object.</summary>
		/// <returns>A new, empty RouteEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new RouteEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRoute
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new RouteEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRouteUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ShuntingCostConfigEntity objects.</summary>
	[Serializable]
	public partial class ShuntingCostConfigEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ShuntingCostConfigEntityFactory() : base("ShuntingCostConfigEntity", NetDon.OA.Data.EntityType.ShuntingCostConfigEntity) { }

		/// <summary>Creates a new, empty ShuntingCostConfigEntity object.</summary>
		/// <returns>A new, empty ShuntingCostConfigEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ShuntingCostConfigEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewShuntingCostConfig
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new ShuntingCostConfigEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewShuntingCostConfigUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty SysParameterEntity objects.</summary>
	[Serializable]
	public partial class SysParameterEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public SysParameterEntityFactory() : base("SysParameterEntity", NetDon.OA.Data.EntityType.SysParameterEntity) { }

		/// <summary>Creates a new, empty SysParameterEntity object.</summary>
		/// <returns>A new, empty SysParameterEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new SysParameterEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewSysParameter
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new SysParameterEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewSysParameterUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty UserEntity objects.</summary>
	[Serializable]
	public partial class UserEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public UserEntityFactory() : base("UserEntity", NetDon.OA.Data.EntityType.UserEntity) { }

		/// <summary>Creates a new, empty UserEntity object.</summary>
		/// <returns>A new, empty UserEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new UserEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewUser
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new UserEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewUserUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty UserRoleEntity objects.</summary>
	[Serializable]
	public partial class UserRoleEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public UserRoleEntityFactory() : base("UserRoleEntity", NetDon.OA.Data.EntityType.UserRoleEntity) { }

		/// <summary>Creates a new, empty UserRoleEntity object.</summary>
		/// <returns>A new, empty UserRoleEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new UserRoleEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewUserRole
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new UserRoleEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewUserRoleUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty VehicleModelEntity objects.</summary>
	[Serializable]
	public partial class VehicleModelEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public VehicleModelEntityFactory() : base("VehicleModelEntity", NetDon.OA.Data.EntityType.VehicleModelEntity) { }

		/// <summary>Creates a new, empty VehicleModelEntity object.</summary>
		/// <returns>A new, empty VehicleModelEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new VehicleModelEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewVehicleModel
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		
		/// <summary>Creates a new VehicleModelEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public override IEntity Create(IEntityFields fields) {
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewVehicleModelUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new entity collection objects</summary>
	[Serializable]
	public partial class GeneralEntityCollectionFactory
	{
		/// <summary>Creates a new entity collection</summary>
		/// <param name="typeToUse">The entity type to create the collection for.</param>
		/// <returns>A new entity collection object.</returns>
		public static IEntityCollection Create(NetDon.OA.Data.EntityType typeToUse)
		{
			switch(typeToUse)
			{
				case NetDon.OA.Data.EntityType.AreaEntity:
					return new AreaCollection();
				case NetDon.OA.Data.EntityType.AttachmentsEntity:
					return new AttachmentsCollection();
				case NetDon.OA.Data.EntityType.CityEntity:
					return new CityCollection();
				case NetDon.OA.Data.EntityType.CompanyEntity:
					return new CompanyCollection();
				case NetDon.OA.Data.EntityType.ConfigurationEntity:
					return new ConfigurationCollection();
				case NetDon.OA.Data.EntityType.CustomerGoodsShippingTypeEntity:
					return new CustomerGoodsShippingTypeCollection();
				case NetDon.OA.Data.EntityType.CustomerInfoEntity:
					return new CustomerInfoCollection();
				case NetDon.OA.Data.EntityType.DeliveryOrderCodeConfigEntity:
					return new DeliveryOrderCodeConfigCollection();
				case NetDon.OA.Data.EntityType.DepartmentEntity:
					return new DepartmentCollection();
				case NetDon.OA.Data.EntityType.DepartmentManagerEntity:
					return new DepartmentManagerCollection();
				case NetDon.OA.Data.EntityType.DictionaryEntity:
					return new DictionaryCollection();
				case NetDon.OA.Data.EntityType.DictionaryCategoryEntity:
					return new DictionaryCategoryCollection();
				case NetDon.OA.Data.EntityType.FunctionEntity:
					return new FunctionCollection();
				case NetDon.OA.Data.EntityType.GoodsTravelDaysConfigEntity:
					return new GoodsTravelDaysConfigCollection();
				case NetDon.OA.Data.EntityType.ImageEntity:
					return new ImageCollection();
				case NetDon.OA.Data.EntityType.IssuingOrderEntity:
					return new IssuingOrderCollection();
				case NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity:
					return new IssuingOrderDeliveryCollection();
				case NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackEntity:
					return new IssuingOrderOnWayTrackCollection();
				case NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackCommentEntity:
					return new IssuingOrderOnWayTrackCommentCollection();
				case NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackHistoryEntity:
					return new IssuingOrderOnWayTrackHistoryCollection();
				case NetDon.OA.Data.EntityType.IssuingOrderReceiptInfoTrackEntity:
					return new IssuingOrderReceiptInfoTrackCollection();
				case NetDon.OA.Data.EntityType.IssuingOrderReceiptInfoTrackCommentEntity:
					return new IssuingOrderReceiptInfoTrackCommentCollection();
				case NetDon.OA.Data.EntityType.IssuingOrderVehicleInfoEntity:
					return new IssuingOrderVehicleInfoCollection();
				case NetDon.OA.Data.EntityType.LogEntity:
					return new LogCollection();
				case NetDon.OA.Data.EntityType.MachineAccountIncomeEntity:
					return new MachineAccountIncomeCollection();
				case NetDon.OA.Data.EntityType.MachineAccountPaymentEntity:
					return new MachineAccountPaymentCollection();
				case NetDon.OA.Data.EntityType.PostEntity:
					return new PostCollection();
				case NetDon.OA.Data.EntityType.ProductEntity:
					return new ProductCollection();
				case NetDon.OA.Data.EntityType.ProvinceEntity:
					return new ProvinceCollection();
				case NetDon.OA.Data.EntityType.ReportEntity:
					return new ReportCollection();
				case NetDon.OA.Data.EntityType.ReportCategoryEntity:
					return new ReportCategoryCollection();
				case NetDon.OA.Data.EntityType.RevenueMachineAccountEntity:
					return new RevenueMachineAccountCollection();
				case NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceEntity:
					return new RevenueMachineAccountInvoiceCollection();
				case NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceOrderEntity:
					return new RevenueMachineAccountInvoiceOrderCollection();
				case NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceReceiptEntity:
					return new RevenueMachineAccountInvoiceReceiptCollection();
				case NetDon.OA.Data.EntityType.RoleEntity:
					return new RoleCollection();
				case NetDon.OA.Data.EntityType.RoleFunctionEntity:
					return new RoleFunctionCollection();
				case NetDon.OA.Data.EntityType.RouteEntity:
					return new RouteCollection();
				case NetDon.OA.Data.EntityType.ShuntingCostConfigEntity:
					return new ShuntingCostConfigCollection();
				case NetDon.OA.Data.EntityType.SysParameterEntity:
					return new SysParameterCollection();
				case NetDon.OA.Data.EntityType.UserEntity:
					return new UserCollection();
				case NetDon.OA.Data.EntityType.UserRoleEntity:
					return new UserRoleCollection();
				case NetDon.OA.Data.EntityType.VehicleModelEntity:
					return new VehicleModelCollection();
				default:
					return null;
			}
		}		
	}
	
	/// <summary>Factory to create new, empty Entity objects based on the entity type specified. Uses entity specific factory objects</summary>
	[Serializable]
	public partial class GeneralEntityFactory
	{
		/// <summary>Creates a new, empty Entity object of the type specified</summary>
		/// <param name="entityTypeToCreate">The entity type to create.</param>
		/// <returns>A new, empty Entity object.</returns>
		public static IEntity Create(NetDon.OA.Data.EntityType entityTypeToCreate)
		{
			IEntityFactory factoryToUse = null;
			switch(entityTypeToCreate)
			{
				case NetDon.OA.Data.EntityType.AreaEntity:
					factoryToUse = new AreaEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.AttachmentsEntity:
					factoryToUse = new AttachmentsEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.CityEntity:
					factoryToUse = new CityEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.CompanyEntity:
					factoryToUse = new CompanyEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.ConfigurationEntity:
					factoryToUse = new ConfigurationEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.CustomerGoodsShippingTypeEntity:
					factoryToUse = new CustomerGoodsShippingTypeEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.CustomerInfoEntity:
					factoryToUse = new CustomerInfoEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.DeliveryOrderCodeConfigEntity:
					factoryToUse = new DeliveryOrderCodeConfigEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.DepartmentEntity:
					factoryToUse = new DepartmentEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.DepartmentManagerEntity:
					factoryToUse = new DepartmentManagerEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.DictionaryEntity:
					factoryToUse = new DictionaryEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.DictionaryCategoryEntity:
					factoryToUse = new DictionaryCategoryEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.FunctionEntity:
					factoryToUse = new FunctionEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.GoodsTravelDaysConfigEntity:
					factoryToUse = new GoodsTravelDaysConfigEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.ImageEntity:
					factoryToUse = new ImageEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderEntity:
					factoryToUse = new IssuingOrderEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity:
					factoryToUse = new IssuingOrderDeliveryEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackEntity:
					factoryToUse = new IssuingOrderOnWayTrackEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackCommentEntity:
					factoryToUse = new IssuingOrderOnWayTrackCommentEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackHistoryEntity:
					factoryToUse = new IssuingOrderOnWayTrackHistoryEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderReceiptInfoTrackEntity:
					factoryToUse = new IssuingOrderReceiptInfoTrackEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderReceiptInfoTrackCommentEntity:
					factoryToUse = new IssuingOrderReceiptInfoTrackCommentEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderVehicleInfoEntity:
					factoryToUse = new IssuingOrderVehicleInfoEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.LogEntity:
					factoryToUse = new LogEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.MachineAccountIncomeEntity:
					factoryToUse = new MachineAccountIncomeEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.MachineAccountPaymentEntity:
					factoryToUse = new MachineAccountPaymentEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.PostEntity:
					factoryToUse = new PostEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.ProductEntity:
					factoryToUse = new ProductEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.ProvinceEntity:
					factoryToUse = new ProvinceEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.ReportEntity:
					factoryToUse = new ReportEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.ReportCategoryEntity:
					factoryToUse = new ReportCategoryEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.RevenueMachineAccountEntity:
					factoryToUse = new RevenueMachineAccountEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceEntity:
					factoryToUse = new RevenueMachineAccountInvoiceEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceOrderEntity:
					factoryToUse = new RevenueMachineAccountInvoiceOrderEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceReceiptEntity:
					factoryToUse = new RevenueMachineAccountInvoiceReceiptEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.RoleEntity:
					factoryToUse = new RoleEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.RoleFunctionEntity:
					factoryToUse = new RoleFunctionEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.RouteEntity:
					factoryToUse = new RouteEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.ShuntingCostConfigEntity:
					factoryToUse = new ShuntingCostConfigEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.SysParameterEntity:
					factoryToUse = new SysParameterEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.UserEntity:
					factoryToUse = new UserEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.UserRoleEntity:
					factoryToUse = new UserRoleEntityFactory();
					break;
				case NetDon.OA.Data.EntityType.VehicleModelEntity:
					factoryToUse = new VehicleModelEntityFactory();
					break;
			}
			IEntity toReturn = null;
			if(factoryToUse != null)
			{
				toReturn = factoryToUse.Create();
			}
			return toReturn;
		}		
	}
	
	/// <summary>Class which is used to obtain the entity factory based on the .NET type of the entity. </summary>
	[Serializable]
	public static class EntityFactoryFactory
	{
#if CF
		/// <summary>Gets the factory of the entity with the NetDon.OA.Data.EntityType specified</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>factory to use or null if not found</returns>
		public static IEntityFactory GetFactory(NetDon.OA.Data.EntityType typeOfEntity)
		{
			return GeneralEntityFactory.Create(typeOfEntity).GetEntityFactory();
		}
#else
		private static Dictionary<Type, IEntityFactory> _factoryPerType = new Dictionary<Type, IEntityFactory>();

		/// <summary>Initializes the <see cref="EntityFactoryFactory"/> class.</summary>
		static EntityFactoryFactory()
		{
			Array entityTypeValues = Enum.GetValues(typeof(NetDon.OA.Data.EntityType));
			foreach(int entityTypeValue in entityTypeValues)
			{
				IEntity dummy = GeneralEntityFactory.Create((NetDon.OA.Data.EntityType)entityTypeValue);
				_factoryPerType.Add(dummy.GetType(), dummy.GetEntityFactory());
			}
		}

		/// <summary>Gets the factory of the entity with the .NET type specified</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>factory to use or null if not found</returns>
		public static IEntityFactory GetFactory(Type typeOfEntity)
		{
			IEntityFactory toReturn = null;
			_factoryPerType.TryGetValue(typeOfEntity, out toReturn);
			return toReturn;
		}

		/// <summary>Gets the factory of the entity with the NetDon.OA.Data.EntityType specified</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>factory to use or null if not found</returns>
		public static IEntityFactory GetFactory(NetDon.OA.Data.EntityType typeOfEntity)
		{
			return GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType());
		}
#endif
	}
	
	/// <summary>Element creator for creating project elements from somewhere else, like inside Linq providers.</summary>
	public class ElementCreator : ElementCreatorBase, IElementCreator
	{
		/// <summary>Gets the factory of the Entity type with the NetDon.OA.Data.EntityType value passed in</summary>
		/// <param name="entityTypeValue">The entity type value.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		public IEntityFactory GetFactory(int entityTypeValue)
		{
			return (IEntityFactory)this.GetFactoryImpl(entityTypeValue);
		}

		/// <summary>Gets the factory of the Entity type with the .NET type passed in</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		public IEntityFactory GetFactory(Type typeOfEntity)
		{
			return (IEntityFactory)this.GetFactoryImpl(typeOfEntity);
		}

		/// <summary>Creates a new resultset fields object with the number of field slots reserved as specified</summary>
		/// <param name="numberOfFields">The number of fields.</param>
		/// <returns>ready to use resultsetfields object</returns>
		public IEntityFields CreateResultsetFields(int numberOfFields)
		{
			return new ResultsetFields(numberOfFields);
		}
		
		/// <summary>Gets an instance of the TypedListDAO class to execute dynamic lists and projections.</summary>
		/// <returns>ready to use typedlistDAO</returns>
		public IDao GetTypedListDao()
		{
			return new TypedListDAO();
		}
		
		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(DerivedTableDefinition leftOperand)
		{
			return new DynamicRelation(leftOperand);
		}

		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperand">The right operand.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(DerivedTableDefinition leftOperand, JoinHint joinType, DerivedTableDefinition rightOperand, IPredicate onClause)
		{
			return new DynamicRelation(leftOperand, joinType, rightOperand, onClause);
		}

		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperandEntityName">Name of the entity, which is used as the right operand.</param>
		/// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(DerivedTableDefinition leftOperand, JoinHint joinType, string rightOperandEntityName, string aliasRightOperand, IPredicate onClause)
		{
			return new DynamicRelation(leftOperand, joinType, (NetDon.OA.Data.EntityType)Enum.Parse(typeof(NetDon.OA.Data.EntityType), rightOperandEntityName, false), aliasRightOperand, onClause);
		}

		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperandEntityName">Name of the entity which is used as the left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperandEntityName">Name of the entity, which is used as the right operand.</param>
		/// <param name="aliasLeftOperand">The alias of the left operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(string leftOperandEntityName, JoinHint joinType, string rightOperandEntityName, string aliasLeftOperand, string aliasRightOperand, IPredicate onClause)
		{
			return new DynamicRelation((NetDon.OA.Data.EntityType)Enum.Parse(typeof(NetDon.OA.Data.EntityType), leftOperandEntityName, false), joinType, (NetDon.OA.Data.EntityType)Enum.Parse(typeof(NetDon.OA.Data.EntityType), rightOperandEntityName, false), aliasLeftOperand, aliasRightOperand, onClause);
		}
				
		/// <summary>Obtains the inheritance info provider instance from the singleton </summary>
		/// <returns>The singleton instance of the inheritance info provider</returns>
		public override IInheritanceInfoProvider ObtainInheritanceInfoProviderInstance()
		{
			return InheritanceInfoProviderSingleton.GetInstance();
		}

		/// <summary>Implementation of the routine which gets the factory of the Entity type with the NetDon.OA.Data.EntityType value passed in</summary>
		/// <param name="entityTypeValue">The entity type value.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		protected override IEntityFactoryCore GetFactoryImpl(int entityTypeValue)
		{
			return EntityFactoryFactory.GetFactory((NetDon.OA.Data.EntityType)entityTypeValue);
		}
#if !CF		
		/// <summary>Implementation of the routine which gets the factory of the Entity type with the .NET type passed in</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		protected override IEntityFactoryCore GetFactoryImpl(Type typeOfEntity)
		{
			return EntityFactoryFactory.GetFactory(typeOfEntity);
		}
#endif
	}
}
